<!DOCTYPE html>
<html lang="en">
<head>
    <include file="Public/head" />
    <script type="text/javascript" src="__PUBLIC__/Home/static/js/jquery.qqFace.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/Home/static/css/index.css"/>
    <script>
        var user = {$user|json_encode};
        if (user.avatar == '') {
            user.avatar = default_avatar;
        }
        {:C('GLOBAL_BDHM')}
    </script>
</head>

<body>
    <!-- 头部 -->
    <include file="Public/header" />
    <!-- /头部 -->

    <div class="main">
        <div class="main-content">
            <div class="sidebar">
                {$selfHtml}
                <div class="recommend">
                    <div class="recommend-title">
                        <div class="title-info">热推视频</div>
                        <div class="change js-fresh-hot">
                            <i class="change-img"></i>
                            <div class="change-span">换一换</div>
                        </div>
                    </div>
                    <include file="Template/hot" />
                </div>
            </div>
            <div class="content-right">
                <include file="Template/trade" />
            </div>
        </div>
    </div>
    <include file="common/footer" />
</body>
<script type="text/javascript" src="__PUBLIC__/Home/static/js/index.js"></script>
<script type="text/javascript">
    var data_url = "{:U('Ucenter/index')}";
    $(window).scroll(function () {
        var scrollTop = $(this).scrollTop();
        var scrollHeight = $(document).height();
        var windowHeight = $(this).height();
        if (scrollTop + windowHeight >= scrollHeight - 5 && !fetching) {
            if (!fetching) {
                var lastEle = $('.content-right-item:last');
                var timestamp = 0;
                if (lastEle[0]) {
                    timestamp = lastEle.attr('data-timestamp');
                }
                var url = data_url + '?timestamp=' + timestamp;
                loadData(url);
            }
        }
    });
    loadData(data_url);
    followCallBack = function(uid, action){
        var cnt = parseInt($('.mine').find('#followCount').attr('data-count'));
        if (action) {
            //取消关注，关注人数减一
            $('.mine').find('#followCount').attr('data-count', (cnt-1));
            $('.mine').find('#followCount').text("关注：" + (cnt-1));
        } else {
            $('.mine').find('#followCount').attr('data-count', (cnt+1));
            $('.mine').find('#followCount').text("关注：" + (cnt+1));
        }
    }

    var height=$(".sidebar").height();
    window.onscroll = function(){
        var t = document.documentElement.scrollTop || document.body.scrollTop;
        if(t>height){
            $(".personal").addClass("fixed");
            $(".my-info").addClass("fixed1");
            $(".personal1").addClass("fixed");
        }else{
            $(".personal").removeClass("fixed");
            $(".my-info").removeClass("fixed1");
            $(".personal1").removeClass("fixed");
        }
    };
</script>
</html>